package com.hackerrank.contests.july13.challenges.hackerranknumber;

public class TestLCM {
	private static long LCM(long a, long b) {
		return a * b / GCF(a, b);
	}
	private static long GCF(long a, long b) {
		return GCFmm(Math.min(a, b), Math.max(a, b));
	}
	private static long GCFmm(long m, long M) {
		if(m == 0)
			return M;
		return GCFmm(M % m, m);
	}
	public static void main(String[] args) {
		long lcm = 1;
		for(int i = 2; i <= 30; i++)
			lcm = LCM(lcm, i);
		System.out.println(lcm);
	}
}
